<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePickingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('picking', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->char('code', 13)->unique()->comment('下架单单号');
            $table->tinyInteger('type')->comment('0 一单一品 1 一单多品');
            $table->integer('count')->comment('订单数量');
            $table->unsignedBigInteger('user_id')->default(0)->comment('下架分配人员');
            $table->tinyInteger('status')->default(0)->comment('状态: 0 待下架 1 已分配 2 已下架');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('picking');
    }
}
